const sohuVideo = require('../../utils/sohuVideo');
//index.js
//获取应用实例
const qqVideo = require('../../utils/sohuVideo');
var app = getApp();
var part_urls = {};
var videoPage;
var pageArr = new Array();
Page({
    data: {
        current: 0,
        list: [],
        url: '',
        title: '',
        desc: '',
        swiper: {
            duration: 300
        }
    },
    onLoad: function(options) {
      console.log('option',options);
      var that = this;
      this.getOpenerEventChannel().on('videoInfo',function(data){
        console.log('传来的参数',data);
        sohuVideo.parseVideoUrl(data.url,function(e){
          console.log('ggggggggggg',e);
          that.setData({
            url: e,
            title: data.title,
            desc: data.desc
          });
        });
      });
    },
    videoErrorCallback: function(e) {
        console.log('视频错误信息:')
        console.log(e.detail.errMsg)
    },
    switchSlider: function (event) {
      this.setData({
        current: event.target.dataset.index
      })
    },

    changeSlider: function (event) {
      this.setData({
        current: event.detail.current
      });
    }


})
